Skip to content

feat(sidebar): let object icons be hidden from a View Options menu - #2037

Merged
datlechin merged 1 commit into
fix/main-build-breakfrom
feat/sidebar-object-icons
Aug 8, 2026
Merged

feat(sidebar): let object icons be hidden from a View Options menu#2037
datlechin merged 1 commit into
fix/main-build-breakfrom
feat/sidebar-object-icons

Conversation

@datlechin

Copy link
Copy Markdown
Member

The sidebar always drew a type icon before every object name, with no way to turn it off. Some people want a plain list of names.

Stacked on #2036, which repairs the two compile errors currently blocking main. Retarget to main once that lands.

What it looks like

WITH ICONS                 WITHOUT ICONS

- cylinder shop_prod       - shop_prod
  - folder public            - public
      table  orders              orders
      table  users               users
      eye    active_users        active_users
      fn     calc_total          calc_total

Where the setting lives

Three entry points, one global preference:

Where Item
Right-click anywhere in the sidebar View Options > Icons / Comments
View menu Show Object Icons, beside Show Object Comments
Settings > General > Sidebar Show object icons

The View menu item is not optional decoration. Apple's guidance on context menus is that "in macOS, an app's menu bar menus list all the app's commands, including those in various context menus", so a command reachable only by right-click is wrong. The menu bar item is the real home; the context menu is the shortcut.

It is a submenu rather than a loose Show Icons checkbox because a display toggle is not an action on the clicked table, and the group will grow. Every database client that puts appearance in a context menu uses a submenu for it (DBeaver's Customize view); the ones with flat menus keep appearance out entirely and put it behind a dedicated options button.

Scope, and why global

The preference is app-wide, on GeneralSettings next to showObjectComments, not per connection.

DBeaver is the cautionary tale here: its equivalent is scoped to "the currently selected database", and its global default applies only to newly created connections, so an existing user flips the global switch and nothing happens. This is a personal visual preference, not a property of a database. Mail, Safari, VS Code, and macOS's own Sidebar icon size all treat it as global.

Hiding covers tables, views, routines, and the database/schema/Recent headers, across the outline tree, both list sidebars, and the Favorites tab. A list that drops table icons but keeps folder icons looks arbitrary.

How it renders

.labelStyle(.titleOnly), through a small sidebarRowIcon(visible:) modifier that sits next to the existing sidebarTint. TitleOnlyLabelStyle removes the icon from layout rather than hiding it, so names align to the disclosure triangle with no leftover gutter. That gutter is the classic defect in this feature (DBeaver #9735 is exactly it). Indentation per level is independent of the icon, so tree alignment is untouched.

The trap this nearly shipped with

The pending truncate/delete badge is an .overlay on the icon image:

Image(systemName: TableRowLogic.iconName(for: table.type))
    .overlay(alignment: .bottomTrailing) { pendingStateBadge }

Applying .titleOnly naively deletes the icon slot and takes the badge with it, so a table staged for deletion would look completely ordinary. The badge now takes over the leading slot when icons are off, so the row keeps its icon slot exactly when it has something to say. TableRowLogic.showsLeadingIcon is the pure decision, and it is the thing the new tests pin.

Accessibility

Nothing is lost to VoiceOver. TableRowLogic.accessibilityLabel already announces the kind (View: active_users) independently of the icon, and a test now pins that it stays true with icons hidden.

Icons are not forced back on under Differentiate Without Color. Hiding them is an explicit, reversible, opt-in user choice, and the default is on.

Tests

TableRowLogicTests covers the leading-icon truth table, including both pending states surviving with icons off. GeneralSettingsObjectIconsTests covers the default, the round trip, independence from showObjectComments, and that settings written before this key existed still decode with icons on.

No UI automation: driving a sidebar context menu needs a live connection, so it does not run deterministically in CI.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@datlechin
datlechin merged commit 5ab1272 into fix/main-build-break Aug 8, 2026
2 of 3 checks passed
@datlechin
datlechin deleted the feat/sidebar-object-icons branch August 8, 2026 11:29
datlechin added a commit that referenced this pull request Aug 8, 2026
…2036)

* fix(sidebar): call the renamed browse database lookup when loading external schemas

* test(datagrid): import TableProPluginKit in the column type quoting tests

* feat(sidebar): let object icons be hidden from a View Options menu (#2037)

* fix(sidebar): apply the icon preference to Redis rows and drop the stray Favorites separator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant